package com.analyse.stock.trade;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
public class TradeResultVo<T> implements Serializable {

    public static final int STATUS_SUCCESS = 0;

    @JSONField(name = "Message")
    private String Message;

    @JSONField(name = "Status")
    private int Status;

    @JSONField(name = "Count")
    private int Count;

    @JSONField(name = "Errcode")
    private int Errcode;

    @JSONField(name = "Data")
    private List<T> Data;

    public boolean success() {
        return TradeResultVo.success(Status);
    }

    public static boolean success(int Status) {
        return Status == TradeResultVo.STATUS_SUCCESS;
    }
}
